.class public Lcom/burstly/lib/component/AdaptorListener;
.super Ljava/lang/Object;
.source "AdaptorListener.java"

# interfaces
.implements Lcom/burstly/lib/component/IBurstlyAdaptorListener;


# static fields
.field private static final GLOBAL_TIMEOUT:I

.field static final LOG:Lcom/burstly/lib/util/LoggerExt;


# instance fields
.field private mClickRedirectUrl:Ljava/lang/String;

.field private final mController:Lcom/burstly/lib/component/AdaptorController;

.field private mForceStop:Z

.field private mHandledFullCycle:Z

.field private final mHandler:Landroid/os/Handler;

.field private mShowingFailed:Z

.field private mTimedOut:Z

.field private final mTimeout:Ljava/lang/Runnable;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 42
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 45
    sget-object v0, Lcom/burstly/lib/constants/Constants;->GLOBAL_ADAPTOR_TIMEOUT:Ljava/lang/String;

    const v1, 0x88b8

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->getIntValue(Ljava/lang/String;Ljava/lang/Integer;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    sput v0, Lcom/burstly/lib/component/AdaptorListener;->GLOBAL_TIMEOUT:I

    .line 46
    return-void
.end method

.method constructor <init>(Lcom/burstly/lib/component/AdaptorController;)V
    .locals 7
    .parameter "controller"

    .prologue
    .line 93
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 94
    iput-object p1, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 95
    new-instance v1, Landroid/os/Handler;

    invoke-direct {v1}, Landroid/os/Handler;-><init>()V

    iput-object v1, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    .line 97
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .line 98
    .local v0, aController:Ljava/lang/ref/Reference;,"Ljava/lang/ref/Reference<Lcom/burstly/lib/component/AdaptorController;>;"
    new-instance v1, Lcom/burstly/lib/component/AdaptorListener$1;

    invoke-direct {v1, p0, v0, p1}, Lcom/burstly/lib/component/AdaptorListener$1;-><init>(Lcom/burstly/lib/component/AdaptorListener;Ljava/lang/ref/Reference;Lcom/burstly/lib/component/AdaptorController;)V

    iput-object v1, p0, Lcom/burstly/lib/component/AdaptorListener;->mTimeout:Ljava/lang/Runnable;

    .line 111
    sget-object v1, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, p1, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v3, "Starting global watchdog with {0} ms timeout..."

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    sget v6, Lcom/burstly/lib/component/AdaptorListener;->GLOBAL_TIMEOUT:I

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 112
    iget-object v1, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    iget-object v2, p0, Lcom/burstly/lib/component/AdaptorListener;->mTimeout:Ljava/lang/Runnable;

    sget v3, Lcom/burstly/lib/component/AdaptorListener;->GLOBAL_TIMEOUT:I

    int-to-long v3, v3

    invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 113
    return-void
.end method

.method static synthetic access$000(Lcom/burstly/lib/component/AdaptorListener;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 32
    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mTimedOut:Z

    return v0
.end method

.method static synthetic access$002(Lcom/burstly/lib/component/AdaptorListener;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 32
    iput-boolean p1, p0, Lcom/burstly/lib/component/AdaptorListener;->mTimedOut:Z

    return p1
.end method

.method static synthetic access$100(Lcom/burstly/lib/component/AdaptorListener;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 32
    invoke-direct {p0}, Lcom/burstly/lib/component/AdaptorListener;->preventDidLoad()Z

    move-result v0

    return v0
.end method

.method static synthetic access$200(Lcom/burstly/lib/component/AdaptorListener;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 32
    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandledFullCycle:Z

    return v0
.end method

.method static synthetic access$202(Lcom/burstly/lib/component/AdaptorListener;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 32
    iput-boolean p1, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandledFullCycle:Z

    return p1
.end method

.method static synthetic access$300(Lcom/burstly/lib/component/AdaptorListener;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 32
    invoke-direct {p0}, Lcom/burstly/lib/component/AdaptorListener;->stopWatching()V

    return-void
.end method

.method static synthetic access$400(Lcom/burstly/lib/component/AdaptorListener;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 32
    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mForceStop:Z

    return v0
.end method

.method static synthetic access$500(Lcom/burstly/lib/component/AdaptorListener;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 32
    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mShowingFailed:Z

    return v0
.end method

.method static synthetic access$502(Lcom/burstly/lib/component/AdaptorListener;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 32
    iput-boolean p1, p0, Lcom/burstly/lib/component/AdaptorListener;->mShowingFailed:Z

    return p1
.end method

.method private preventDidLoad()Z
    .locals 1

    .prologue
    .line 192
    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mTimedOut:Z

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mForceStop:Z

    if-eqz v0, :cond_1

    iget-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandledFullCycle:Z

    if-eqz v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private stopWatching()V
    .locals 4

    .prologue
    .line 199
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/burstly/lib/component/AdaptorListener;->mTimeout:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 200
    sget-object v0, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v1, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    iget-object v1, v1, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v2, "Released global adaptor watchdog."

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 201
    return-void
.end method


# virtual methods
.method public adWasClicked(Ljava/lang/String;Z)V
    .locals 5
    .parameter "networkName"
    .parameter "isInterstitial"

    .prologue
    .line 117
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 118
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    sget-object v1, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, v0, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v3, "Adaptor was clicked"

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 119
    invoke-virtual {v0}, Lcom/burstly/lib/component/AdaptorController;->click()V

    .line 120
    return-void
.end method

.method public didLoad(Ljava/lang/String;Z)V
    .locals 3
    .parameter "networkName"
    .parameter "isInterstitial"

    .prologue
    .line 124
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 125
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    new-instance v1, Lcom/burstly/lib/component/AdaptorListener$2;

    invoke-direct {v1, p0, v0, p2}, Lcom/burstly/lib/component/AdaptorListener$2;-><init>(Lcom/burstly/lib/component/AdaptorListener;Lcom/burstly/lib/component/AdaptorController;Z)V

    .line 143
    .local v1, runnable:Ljava/lang/Runnable;
    iget-object v2, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    invoke-virtual {v2, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 144
    return-void
.end method

.method public dismissedFullscreen(Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;)V
    .locals 3
    .parameter "info"

    .prologue
    .line 259
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 260
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    new-instance v1, Lcom/burstly/lib/component/AdaptorListener$4;

    invoke-direct {v1, p0, v0, p1}, Lcom/burstly/lib/component/AdaptorListener$4;-><init>(Lcom/burstly/lib/component/AdaptorListener;Lcom/burstly/lib/component/AdaptorController;Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;)V

    .line 268
    .local v1, runnable:Ljava/lang/Runnable;
    iget-object v2, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    invoke-virtual {v2, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 269
    return-void
.end method

.method public failedToLoad(Ljava/lang/String;ZLjava/lang/String;)V
    .locals 3
    .parameter "networkName"
    .parameter "isInterstitial"
    .parameter "causeOfFailure"

    .prologue
    .line 148
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 149
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    new-instance v1, Lcom/burstly/lib/component/AdaptorListener$3;

    invoke-direct {v1, p0, v0, p3, p2}, Lcom/burstly/lib/component/AdaptorListener$3;-><init>(Lcom/burstly/lib/component/AdaptorListener;Lcom/burstly/lib/component/AdaptorController;Ljava/lang/String;Z)V

    .line 182
    .local v1, runnable:Ljava/lang/Runnable;
    iget-object v2, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    invoke-virtual {v2, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 183
    return-void
.end method

.method forceStop()V
    .locals 1

    .prologue
    .line 235
    invoke-direct {p0}, Lcom/burstly/lib/component/AdaptorListener;->stopWatching()V

    .line 236
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mForceStop:Z

    .line 237
    return-void
.end method

.method public getClickRedirectUrl()Ljava/lang/String;
    .locals 1

    .prologue
    .line 245
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mClickRedirectUrl:Ljava/lang/String;

    return-object v0
.end method

.method public onCollapse(Ljava/lang/String;)V
    .locals 5
    .parameter "networkName"

    .prologue
    .line 212
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 213
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    sget-object v1, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, v0, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v3, "Adaptor was collapsed"

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 214
    invoke-virtual {v0}, Lcom/burstly/lib/component/AdaptorController;->getBursltlyAdListener()Lcom/burstly/lib/component/IInternalBurstlyAdListener;

    move-result-object v1

    invoke-interface {v1}, Lcom/burstly/lib/component/IInternalBurstlyAdListener;->onCollapse()V

    .line 215
    return-void
.end method

.method public onExpand(Ljava/lang/String;Z)V
    .locals 7
    .parameter "networkName"
    .parameter "isFullscreen"

    .prologue
    .line 205
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 206
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    sget-object v1, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, v0, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v3, "Adaptor was expanded (isFullscreen {0})"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    invoke-static {p2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 207
    invoke-virtual {v0}, Lcom/burstly/lib/component/AdaptorController;->getBursltlyAdListener()Lcom/burstly/lib/component/IInternalBurstlyAdListener;

    move-result-object v1

    invoke-interface {v1, p2}, Lcom/burstly/lib/component/IInternalBurstlyAdListener;->onExpand(Z)V

    .line 208
    return-void
.end method

.method public onHide(Ljava/lang/String;)V
    .locals 5
    .parameter "networkName"

    .prologue
    .line 226
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 227
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    sget-object v1, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, v0, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v3, "Adaptor was hidden"

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 228
    invoke-virtual {v0}, Lcom/burstly/lib/component/AdaptorController;->getBursltlyAdListener()Lcom/burstly/lib/component/IInternalBurstlyAdListener;

    move-result-object v1

    invoke-interface {v1}, Lcom/burstly/lib/component/IInternalBurstlyAdListener;->onHide()V

    .line 229
    return-void
.end method

.method public onShow(Ljava/lang/String;)V
    .locals 5
    .parameter "networkName"

    .prologue
    .line 219
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 220
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    sget-object v1, Lcom/burstly/lib/component/AdaptorListener;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, v0, Lcom/burstly/lib/component/AdaptorController;->mTag:Ljava/lang/String;

    const-string v3, "Adaptor was shown"

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 221
    invoke-virtual {v0}, Lcom/burstly/lib/component/AdaptorController;->getBursltlyAdListener()Lcom/burstly/lib/component/IInternalBurstlyAdListener;

    move-result-object v1

    invoke-interface {v1}, Lcom/burstly/lib/component/IInternalBurstlyAdListener;->onShow()V

    .line 222
    return-void
.end method

.method public setClickRedirectUrl(Ljava/lang/String;)V
    .locals 0
    .parameter "clickRedirectUrl"

    .prologue
    .line 254
    iput-object p1, p0, Lcom/burstly/lib/component/AdaptorListener;->mClickRedirectUrl:Ljava/lang/String;

    .line 255
    return-void
.end method

.method public shownFullscreen(Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;)V
    .locals 3
    .parameter "info"

    .prologue
    .line 273
    iget-object v0, p0, Lcom/burstly/lib/component/AdaptorListener;->mController:Lcom/burstly/lib/component/AdaptorController;

    .line 274
    .local v0, comp:Lcom/burstly/lib/component/AdaptorController;
    new-instance v1, Lcom/burstly/lib/component/AdaptorListener$5;

    invoke-direct {v1, p0, v0, p1}, Lcom/burstly/lib/component/AdaptorListener$5;-><init>(Lcom/burstly/lib/component/AdaptorListener;Lcom/burstly/lib/component/AdaptorController;Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;)V

    .line 284
    .local v1, runnable:Ljava/lang/Runnable;
    iget-object v2, p0, Lcom/burstly/lib/component/AdaptorListener;->mHandler:Landroid/os/Handler;

    invoke-virtual {v2, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 285
    return-void
.end method
